<?php

namespace common\models\db\tables;

use Yii;

/**
 * This is the model class for table "{{%suppliers}}".
 *
 * @property int $id
 * @property string $name
 * @property string $mobile
 * @property int $created_at
 * @property int $updated_at
 * @property int|null $created_by_adminer
 * @property int|null $updated_by_adminer
 * @property int $status
 * @property int $is_super
 * @property string $password
 * @property string $pwd_back
 * @property string $token
 * @property string $key
 */
class Suppliers extends \yii\db\ActiveRecord
{
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return '{{%suppliers}}';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['name', 'mobile', 'created_at', 'updated_at', 'created_by_adminer', 'updated_by_adminer', 'status', 'is_super', 'password', 'pwd_back', 'token', 'key'], 'trim'],
            [['name', 'mobile', 'created_at', 'updated_at', 'password', 'pwd_back', 'token', 'key'], 'required'],
            [['created_at', 'updated_at', 'created_by_adminer', 'updated_by_adminer', 'status', 'is_super'], 'integer'],
            [['password', 'pwd_back'], 'string'],
            [['name'], 'string', 'max' => 180],
            [['mobile'], 'string', 'max' => 11],
            [['token', 'key'], 'string', 'max' => 32],
            [['created_by_adminer', 'updated_by_adminer'], 'default', 'value' => null],
            [['status'], 'default', 'value' => 200],
            [['is_super'], 'default', 'value' => 2],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'id' => Yii::t('app', 'ID'),
            'name' => Yii::t('app', 'Name'),
            'mobile' => Yii::t('app', 'Mobile'),
            'created_at' => Yii::t('app', 'Created At'),
            'updated_at' => Yii::t('app', 'Updated At'),
            'created_by_adminer' => Yii::t('app', 'Created By Adminer'),
            'updated_by_adminer' => Yii::t('app', 'Updated By Adminer'),
            'status' => Yii::t('app', 'Status'),
            'is_super' => Yii::t('app', 'Is Super'),
            'password' => Yii::t('app', 'Password'),
            'pwd_back' => Yii::t('app', 'Pwd Back'),
            'token' => Yii::t('app', 'Token'),
            'key' => Yii::t('app', 'Key'),
        ];
    }
}
